Skip to content

internal: Align MIR ProjectionElem more with rustc's version and simplify it#22510

Merged
flodiebold merged 2 commits into
rust-lang:masterfrom
flodiebold:mir-salsa-projections
Jun 3, 2026
Merged

internal: Align MIR ProjectionElem more with rustc's version and simplify it#22510
flodiebold merged 2 commits into
rust-lang:masterfrom
flodiebold:mir-salsa-projections

Conversation

@flodiebold
Copy link
Copy Markdown
Member

  • Instead of three Field variants, we now have just one that takes just a field index, like rustc (except rustc also tracks the type).
  • Enum variant downcasting in patterns is handled with the Downcast projection like in rustc; previously it happened implicitly through the FieldId which knew its variant
  • Introduce PlaceTy helper for this variant downcasting
  • Align projection_ty code mostly with rustc
  • Remove unused OpaqueCast variant for now

…ant ID / tuple ID needed)

bring back env for projection_ty
cleanups
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 1, 2026
@flodiebold flodiebold force-pushed the mir-salsa-projections branch from f10f7ae to d8155bc Compare June 3, 2026 18:01
@flodiebold flodiebold force-pushed the mir-salsa-projections branch from d8155bc to 71a9c63 Compare June 3, 2026 18:25
@flodiebold flodiebold added this pull request to the merge queue Jun 3, 2026
Merged via the queue into rust-lang:master with commit 9b9f59c Jun 3, 2026
18 checks passed
@flodiebold flodiebold deleted the mir-salsa-projections branch June 3, 2026 18:45
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants